<template>
	<view class="content">
		<view class="list">
			<view class="item" v-for="item in list" @click="goDetail(item)">
				<view class="box">
					<view class="name">
						{{item.name}}
					</view>
					<view class="address">
						车辆类型：{{item.cartype}}
					</view>
					<view class="address">
						注册日期：{{item.bxdjr}}
					</view>
					<image @click.stop="callPhone(item)" src="../../static/call.png" mode="" class="distance"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[],
			}
		},
		onShow() {
			this.getList()
		},
		onLoad(options) {
			
		},
		methods: {
			goDetail(item) {
				console.log(item)
				uni.navigateTo({
					url: `/pages/my/vipDetail?id=${item.id}`
				})
			},
			getList() {
				this.$get('shop/customerlist', {page:1,pagesize:1000}, (res) => {
					this.list = res
				})
			},
			callPhone(item){
				uni.makePhoneCall({
					phoneNumber: item.mobile //仅为示例
				});
			}
		},
		onShareAppMessage(){
			
		}
	}
</script>

<style>
	page {
		box-sizing: border-box;
	}

	.list {
		
	}
	
	.list .item{
		background-color: #FFFFFF;
		padding: 30rpx;
		border-bottom: 1px solid #E3E3E3;
		position: relative;
	}
	.list .item .box{
		position: relative;
		padding-left: 20rpx;
	}

	.list .item image {
		width: 148rpx;
		height: 148rpx;
		border-radius: 14rpx;
	}
	.list .item .name{
		font-size: 34rpx;
		margin-bottom: 20rpx;
		color: #111111;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
		margin-top: 10rpx;
	}
	.list .item .address{
		font-size: 26rpx;
		color: #666666;
		line-height: 45rpx;
		margin-bottom: 10rpx;
	}
	.list .item .distance{
		position: absolute;
		right: 20rpx;
		top: 60rpx;
		width: 62rpx;
		height: 62rpx;
	}
</style>
